import { createRouter, createWebHashHistory } from "vue-router";

const routes = [{
    path: "/",
    redirect: "/index"
}, {
    path: "/index",
    component: () =>
        import ("../views/index/index.vue"),
    children: [{
        path: "/index",
        redirect: "/index/home"
    }, {
        path: "/index/home",
        component: () =>
            import ("../views/index/home/index.vue")
    }, {
        path: "/index/commodity",
        component: () =>
            import ("../views/index/commodity/index.vue")
    }, {
        path: "/index/evaluation",
        component: () =>
            import ("../views/index/evaluation/index.vue")
    }, {
        path: "/index/order",
        component: () =>
            import ("../views/index/order/index.vue")
    }, {
        path: "/index/sale",
        component: () =>
            import ("../views/index/sale/index.vue")
    }, {
        path: "/index/group",
        component: () =>
            import ("../views/index/group/index.vue")
    }, {
        path: "/index/address",
        component: () =>
            import ("../views/index/address/index.vue")
    }, {
        path: "/index/file",
        component: () =>
            import ("../views/index/file/index.vue"),
            children:[
                {
                    path: "/index/file",
                    redirect: "/index/file/filelist"
                },
                {
                    path:"/index/file/filelist",
                    component:()=>import ("../views/index/file/filelist/index.vue")
                }
            ]
    }, {
        path: "/index/wallet",
        component: () =>
            import ("../views/index/wallet/index.vue")
    }, {
        path: "/index/system",
        component: () =>
            import ("../views/index/system/index.vue")
    }, {
        path: "/index/account",
        component: () =>
            import ("../views/index/account/index.vue")
    }, ]
}];

const router = createRouter({
    history: createWebHashHistory(),
    routes,
});

export default router;